package com.example.administrator.uis.view

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View

/**
 * Created by Administrator on 2017/11/10 0010.
 */
class PracticeDrawCircleView : View {
    constructor(context: Context?):super(context) {
    }
    constructor(context: Context?, attrs: AttributeSet?):super(context,attrs){
    }
    constructor(context: Context?, attrs: AttributeSet?, defStyle:Int):super(context, attrs,defStyle){

    }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        var paint=Paint()

        canvas?.drawCircle(100.0f,100.0f,50f,paint)
        paint.style=Paint.Style.STROKE
        canvas?.drawCircle(210.0f,100.0f,50f,paint)
        paint.strokeWidth=10f;
        canvas?.drawCircle(330.0f,100.0f,50f,paint)

        var paintnewcolor=Paint()
        paintnewcolor.color=Color.BLUE
        paintnewcolor.isAntiAlias=true
        canvas?.drawCircle(440f,100f,50f,paintnewcolor)


    }

}